package com.javalab._7thread._5ThreadPool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class _01SingleThreadPool {
    public static void main(String[] args) {
        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程执行...");
                try {
                    Thread.sleep(1000L);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("线程结束！");
            }
        });
        executor.shutdown();
//        executor.shutdownNow();
    }
}
